[!set(Dual, "TRUE")]
[!newguid(InterfaceGUID)]
[!GetTemporaryFileName(RCTemp)]
[!target(RCTemp)]
// Since the commerce components require the C-Runtime, we need
// to undefine this symbol to make certain CRT is available to us.
#ifdef _ATL_MIN_CRT
#undef _ATL_MIN_CRT
#endif
[!crlf]
// The commerce components also requires a UNICODE build.  The 
// lines below will essentially make ALL BUILDS into UNICODE 
// builds.
#ifdef _MBCS
#undef _MBCS
#define _UNICODE
#endif
[!crlf]
[!target()]
[!Dialog("Names98", "CommercePPG")]

[!strcpy(UpperShortName, ShortName)]
[!toupper(UpperShortName)]

[!AddSymbolToString(header, "\"", HeaderName)]
[!AddStringToSymbol(header, header, "\"")]
[!AddIncludeFile(ProjectNameCPP,  header)]

[!AddSymbolToString(IDR_REGISTRYID, "IDR_", UpperShortName)]

[!AddSymbolToString(IDR_QUERYSTRINGFIRSTHALF, "IDR_", UpperShortName)]
[!AddStringToSymbol(IDR_QUERYSTRING, IDR_QUERYSTRINGFIRSTHALF, "QUERYSTRING")]

[!AddStringToSymbol(HeaderTemplate, GalleryPath, "CommerceComp.h")]
[!AddStringToSymbol(CPPTemplate, GalleryPath, "CommerceComp.cpp")]
[!AddStringToSymbol(RGSTemplate, GalleryPath, "CommerceComp.rgs")]

[!AddStringToSymbol(CompUtilCPP, GalleryPath, "computil.cpp")]
[!AddStringToSymbol(CompUtilH, GalleryPath, "computil.h")]

[!AddStringToSymbol(SmartDictH, GalleryPath, "SmartDict.h")]
[!AddStringToSymbol(SmartDictCPP, GalleryPath, "SmartDict.cpp")]

[!AddStringToSymbol(MoneyInfoH, GalleryPath, "moneyinfo.h")]
[!AddStringToSymbol(MoneyInfoCPP, GalleryPath, "moneyinfo.cpp")]

[!AddStringToSymbol(CacheLoaderSrcSQL, GalleryPath, "CacheLoaderSQL.sql")]
[!AddStringToSymbol(CacheLoaderDestSQL, ShortName, "SQL.sql")]

[!target(HeaderName)]
[!include(HeaderTemplate)]
[!target()]

[!target(CPPName)]
[!include(CPPTemplate)]
[!target()]

[!set(computil.h, "computil.h")]
[!CopyFile(CompUtilH, computil.h)]

[!set(computil.cpp, "computil.cpp")]
[!CopyFile(CompUtilCPP, computil.cpp)]

[!set(SmartDict.h, "SmartDict.h")]
[!CopyFile(SmartDictH, SmartDict.h)]

[!set(SmartDict.cpp, "SmartDict.cpp")]
[!CopyFile(SmartDictCPP, SmartDict.cpp)]

[!set(moneyinfo.h, "moneyinfo.h")]
[!CopyFile(MoneyInfoH, moneyinfo.h)]

[!set(moneyinfo.cpp, "moneyinfo.cpp")]
[!CopyFile(MoneyInfoCPP, moneyinfo.cpp)]

[!if=(CacheLoader, "TRUE")]
	[!CopyFile(CacheLoaderSrcSQL, CacheLoaderDestSQL)]
[!endif]

[!AddStringToSymbol(RGSName, ShortName, ".rgs")]
[!target(RGSName)]
[!include(RGSTemplate)]
[!target()]

[!AddStringToSymbol(IDLInterface, GalleryPath, "objint.idl")]
[!AddStringToSymbol(IDLCoClass, GalleryPath, "objco.idl")]
[!AddInterfaceToIDL(IDLProject, IDLInterface)]
[!AddCoClassToIDL(IDLProject, IDLCoClass)]

[!target(IDLName)]
[!include(IDLTemplate)]
[!target()]

[!AddToObjectMap(CoClassName, ClassName)]

[!set(initguid.h, "<initguid.h>")]
[!set(mspu_guids.h, "\"mspu_guids.h\"")]

[!AddIncludeFile(ProjectNameCPP, initguid.h)]
[!AddIncludeFile(ProjectNameCPP, mspu_guids.h)]

[!AddImportFile(IDLProject, "oaidl.idl")]

[!AddFileToProject(CPPName)]
[!AddFileToProject(HeaderName)]
[!AddFileToProject(computil.h)]
[!AddFileToProject(computil.cpp)]
[!AddFileToProject(SmartDict.h)]
[!AddFileToProject(SmartDict.cpp)]
[!AddFileToProject(moneyinfo.h)]
[!AddFileToProject(moneyinfo.cpp)]


[!set(IDS_DICTUTIL_ERRDICTMISSING, "IDS_DICTUTIL_ERRDICTMISSING")]
[!set(IDS_DICTUTIL_ERRDICTMISSING_value, "Dictionary error: Value for key '%s' in dictionary '%s' missing (expected a variant of type %d)")]
[!AddStringResource(IDS_DICTUTIL_ERRDICTMISSING, IDS_DICTUTIL_ERRDICTMISSING_value)]

[!set(IDS_DICTUTIL_ERRDICTTYPE, "IDS_DICTUTIL_ERRDICTTYPE")]
[!set(IDS_DICTUTIL_ERRDICTTYPE_value, "Dictionary error: Value for key '%s' in dictionary '%s' is of the wrong type (expected a variant of type %d, got %d)")]
[!AddStringResource(IDS_DICTUTIL_ERRDICTTYPE, IDS_DICTUTIL_ERRDICTTYPE_value)]

[!set(IDS_DICTUTIL_ERRDICTINTERFACE, "IDS_DICTUTIL_ERRDICTINTERFACE")]
[!set(IDS_DICTUTIL_ERRDICTINTERFACE_value, "Dictionary error: Value for key '%s' in dictionary '%s' doesn't support request interface '%s'")]
[!AddStringResource(IDS_DICTUTIL_ERRDICTINTERFACE, IDS_DICTUTIL_ERRDICTINTERFACE_value)]

[!set(IDS_DICTUTIL_ERRDICTMISSINGNOTYPE, "IDS_DICTUTIL_ERRDICTMISSINGNOTYPE")]
[!set(IDS_DICTUTIL_ERRDICTMISSINGNOTYPE_value, "Dictionary error: Value for key '%s' in dictionary '%s' is missing")]
[!AddStringResource(IDS_DICTUTIL_ERRDICTMISSINGNOTYPE, IDS_DICTUTIL_ERRDICTMISSINGNOTYPE_value)]

[!set(IDS_DICTUTIL_MISMATCHEDMONEY, "IDS_DICTUTIL_MISMATCHEDMONEY")]
[!set(IDS_DICTUTIL_MISMATCHEDMONEY_value, "Error: '%s' and '%s' are inconsistent. This is most likely caused by running a legacy pipeline component in the same stage as a newer pipeline component without proper sychronization.")]
[!AddStringResource(IDS_DICTUTIL_MISMATCHEDMONEY, IDS_DICTUTIL_MISMATCHEDMONEY_value)]

[!set(IDS_LISTHELPER_ERRLISTTYPE, "IDS_LISTHELPER_ERRLISTTYPE")]
[!set(IDS_LISTHELPER_ERRLISTTYPE_value, "SimpleList error: Value at index %d in list '%s' is of the wrong type (expected a variant of type %d, got %d)")]
[!AddStringResource(IDS_LISTHELPER_ERRLISTTYPE, IDS_LISTHELPER_ERRLISTTYPE_value)]

[!set(IDS_LISTHELPER_ERRLISTTYPENOINDEX, "IDS_LISTHELPER_ERRLISTTYPENOINDEX")]
[!set(IDS_LISTHELPER_ERRLISTTYPENOINDEX_value, "SimpleList error: A value in the list '%s' is of the wrong type (expected a variant of type %d, got %d)")]
[!AddStringResource(IDS_LISTHELPER_ERRLISTTYPENOINDEX, IDS_LISTHELPER_ERRLISTTYPENOINDEX_value)]

[!set(IDS_LISTHELPER_ERRLISTINTERFACE, "IDS_LISTHELPER_ERRLISTINTERFACE")]
[!set(IDS_LISTHELPER_ERRLISTINTERFACE_value, "SimpleList error: value at index %d in list '%s' doesn't support request interface '%s'")]
[!AddStringResource(IDS_LISTHELPER_ERRLISTINTERFACE, IDS_LISTHELPER_ERRLISTINTERFACE_value)]


[!set(IDS_OVERFLOW, "IDS_OVERFLOW")]
[!set(IDS_OVERFLOW_value, "An overflow occurred; the system encountered a number too large or too small to handle.")]
[!AddStringResource(IDS_OVERFLOW, IDS_OVERFLOW_value)]

[!set(IDS_ERROR_GETTING_CHILD_OBJECT, "IDS_ERROR_GETTING_CHILD_OBJECT")]
[!set(IDS_ERROR_GETTING_CHILD_OBJECT_value, "Error getting child object from root orderform.")]
[!AddStringResource(IDS_ERROR_GETTING_CHILD_OBJECT, IDS_ERROR_GETTING_CHILD_OBJECT_value)]


[!set(IDS_MONEY_OVERFLOW, "IDS_MONEY_OVERFLOW")]
[!set(IDS_MONEY_OVERFLOW_value, "An overflow occurred.")]
[!AddStringResource(IDS_MONEY_OVERFLOW, IDS_MONEY_OVERFLOW_value)]

[!set(IDS_MONEY_OVERFLOW_UPGRADABLE, "IDS_MONEY_OVERFLOW_UPGRADABLE")]
[!set(IDS_MONEY_OVERFLOW_UPGRADABLE_value, "An overflow occurred.  Consult the documentation for information on extending the range.")]
[!AddStringResource(IDS_MONEY_OVERFLOW_UPGRADABLE, IDS_MONEY_OVERFLOW_UPGRADABLE_value)]

[!set(IDS_MONEY_OVERFLOW_ON_KEY, "IDS_MONEY_OVERFLOW_ON_KEY")]
[!set(IDS_MONEY_OVERFLOW_ON_KEY_value, "An overflow occurred when computing '%s'.")]
[!AddStringResource(IDS_MONEY_OVERFLOW_ON_KEY, IDS_MONEY_OVERFLOW_ON_KEY_value)]

[!set(IDS_MONEY_OVERFLOW_ON_KEY_UPGRADABLE, "IDS_MONEY_OVERFLOW_ON_KEY_UPGRADABLE")]
[!set(IDS_MONEY_OVERFLOW_ON_KEY_UPGRADABLE_value, "An overflow occurred when computing '%s'.  Consult the documentation for information on extending the range.")]
[!AddStringResource(IDS_MONEY_OVERFLOW_ON_KEY_UPGRADABLE, IDS_MONEY_OVERFLOW_ON_KEY_UPGRADABLE_value)]


[!AddRegistryToRC(RGSName, IDR_REGISTRYID)]
[!if=(CacheLoader, "TRUE")]
	[!AddResourceFromFile(CacheLoaderDestSQL, IDR_QUERYSTRING, "SQL")]
[!endif]

[!if=(ReplaceStdAfxH, "TRUE")]
	[!DeleteFile(STDAFXH)]
	[!CopyFile(RCTemp, STDAFXH)]
[!endif]
[!DeleteFile(RCTemp)]



